//
//  KindCollectionViewCell.m
//  EarnBao
//
//  Created by iMac on 15/4/16.
//  Copyright (c) 2015年 杭州赚宝科技有限公司. All rights reserved.
//

#import "KindCollectionViewCell.h"
#import "Kind.h"
#import "UIImageView+WebCache.h"

@implementation KindCollectionViewCell

- (void)setSubview
{
    self.contentView.backgroundColor = [UIColor whiteColor];
    
    self.imgLView = [[ImgLView alloc] initWithFrame:CGRectMake(0, 0, self.contentView.bounds.size.width, self.contentView.bounds.size.width*4/3)];
    [self.contentView addSubview:_imgLView];
}

//初始化
- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self setSubview];
    }
    return self;
}

-(void)setKind:(Kind *)kind
{
    //第三方方法加载图片
    [_imgLView.imageView sd_setImageWithURL:[NSURL URLWithString:kind.img] placeholderImage:[UIImage imageNamed:@"placeholder"]];
    _imgLView.label.text = kind.name;
}

@end
